package com.blackoreo.monitor.entry;

import java.util.Objects;

/**
 * PackageName: com.blackoreo.monitor.entry
 * Author: txw
 * Date: 2021/4/8
 * Description:
 */
public abstract class BlackOreoEntry {
    public String name;
    public String description;
    public long updateTime;
    public String unitName;

    public BlackOreoEntry(String name, String description, String unitName) {
        this.name = name;
        this.description = description;
        this.unitName = unitName;
    }

    /*getter & setter*/

    public void resetTime() {
        this.updateTime = System.currentTimeMillis();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BlackOreoEntry that = (BlackOreoEntry) o;
        return name.equals(that.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        this.updateTime = updateTime;
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }
}
